package com.fly.client1.config;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;

/**
 * @ClassName: RestTemplateConfig
 * @Author: 1603020074@qq.com
 * @Date: 2019/8/1 14:38
 * @Version: 1.0
 * @Description: TODO
 **/
@Component
public class RestTemplateConfig {

    @Autowired
    private RestTemplateBuilder builder;

    @Bean("restTemplate")
    @Primary
    public RestTemplate restTemplate() {
        return builder.build();
    }

}
